package com.lipl.base.javaee.netty.nio;

import java.nio.ByteBuffer;

/**
 * @Auther: 15541
 * @Date: 2020/10/31 21:28
 * @Description:
 */
public class NIOByteBufferPutGet {
    public static void main(String[] args) {

        ByteBuffer byteBuffer = ByteBuffer.allocate(64);

        byteBuffer.putInt(100);
        byteBuffer.putLong(9);
        byteBuffer.putChar('里');
        byteBuffer.putShort((short)4);

        byteBuffer.flip();

        System.out.println(byteBuffer.getInt());
        System.out.println(byteBuffer.getLong());
        System.out.println(byteBuffer.getChar());
        System.out.println(byteBuffer.getShort());

    }
}

